
let util = {
    toDateString:function (type,time){
        // let time = parseInt(time);
        let dt = new Date(time).getTime();
        let y = new Date(dt).getFullYear();
        let m = new Date(dt).getMonth();
        let d = new Date(dt).getDay();
        let h = new Date(dt).getHours();
        let mm = new Date(dt).getMinutes();
        let s = new Date(dt).getSeconds();
        let heng = '-';
        let mao = ':';
        let kong = ' ';
        if(type == 'date'){
            return y+heng+m+heng+d
        }
        if(type == 'time'){
            return h+mao+mm+mao+s
        }
        if(type == 'datetime'){
            return y+heng+m+heng+d+kong+h+mao+mm+mao+s
        }

    }
}





module.exports = util